<template>
  <el-table v-loading="loading" :data="eventList">
    <el-table-column label="事件名称" prop="accName" />
    <el-table-column label="事件等级" prop="accLevel" />
    <el-table-column label="问题描述" prop="description" />
    <el-table-column label="当前状态" prop="status" />
    <el-table-column label="问题发生时间" width="180">
      <template slot-scope="scope">
        <span>{{ parseTime(scope.row.start_time) }}</span>
      </template>
    </el-table-column>
    <el-table-column label="最近更新时间" width="180">
      <template slot-scope="scope">
        <span>{{ parseTime(scope.row.start_time) }}</span>
      </template>
    </el-table-column>
    <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <template slot-scope="scope">
        <el-button
          size="mini"
          type="text"
          icon="el-icon-tickets"
          @click="goDetailPage(scope.row)"
        >详情</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>
<script>
export default {
  name: 'ClientEventList',
  props: {
    certNo: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      loading: false,
      eventList: [
        { id: 1, timestamp: '2022-12-11', title: '1xx' },
        { id: 2, timestamp: '2022-12-12', title: '2xx' },
        { id: 3, timestamp: '2022-12-13', title: '3xx' },
        { id: 4, timestamp: '2022-12-14', title: '4xx' }
      ]
    }
  },
  methods: {
    goDetailPage(row) {
      this.$router.push({
        name: 'ClientEventDetail',
        params: { certNo: this.cert_no || '1', id: row.id || '1' }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.more {
  float: right;
  font-size: 14px;
}
</style>
